// -*-c++-*- Copyright (C) 2011 osgPango Development Team
// $Id$

#ifndef OSGPANGO_SHADER_MANAGER
#define OSGPANGO_SHADER_MANAGER

#include <map>
#include <osg/Shader>
#include <osgPango/Export>

namespace osgPango {

class OSGPANGO_EXPORT ShaderManager {
public:
	~ShaderManager();

	static ShaderManager& instance();

	bool addShader       (const std::string&, osg::Shader*);
	bool addShaderSource (const std::string&, osg::Shader::Type, const std::string&);
	bool addShaderFile   (const std::string&, osg::Shader::Type, const std::string&);
	
	osg::Shader* getShader(const std::string&);

private:
	typedef std::map<std::string, osg::ref_ptr<osg::Shader> > ShaderMap;

	ShaderManager();

	static ShaderManager _shaderManager;

	ShaderMap _shaders;
};

}

#endif
